'use strict';

class AppBootHook {
  constructor(app) {
    this.app = app;
  }
  async serverDidReady() {
    const { app } = this;
    // 注册超管
    const userModel = app.getModel('user');
    const exist = await userModel.qk.exist({ account: 'super' });
    if (!exist) {
      await userModel.create({ account: 'super', password: '123456' });
    }
  }
}

module.exports = AppBootHook;
